<template>
  <div class="tableItem">
    <el-table
      ref="multipleTable"
      :data="tableData"
      tooltip-effect="dark"
      class="advTable"
      stripe
      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
    >
      >
      <el-table-column label="序号" prop="index" type="index" align="center"></el-table-column>
      <el-table-column
        v-for="(item, index) in tableLabel"
        :key="index"
        :prop="item.prop"
        :label="item.label"
        align="center"
        :show-overflow-tooltip="true"
      ></el-table-column>
      <el-table-column prop="enterpriseEvaluation" label="(企业)评价" align="center">
        <template slot-scope="{row}">
          <el-rate disabled v-model="row.value1" :colors="colors" score-template="{row.value1}"></el-rate>
        </template>
      </el-table-column>
      <el-table-column prop="comprehensiveEvaluation" label="(管理员)综合评价" align="center">
        <template slot-scope="{row}">
          <el-rate disabled v-model="row.value2" :colors="colors" score-template="{row.value2}"></el-rate>
        </template>
      </el-table-column>
      <el-table-column prop="enclosure" label="附件" align="center" v-if="Ifenclosure">
        <template slot-scope="{row}">
          <a :href="row.enclosure">
            <el-button type="primary" icon="el-icon-download">下载</el-button>
          </a>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="100" align="center" v-if="Ifoperate">
        <template slot-scope="scope">
          <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
          <el-button @click="forbiddenClick(scope.row)" type="text" size="small">禁用</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: ["tableLabel", "tableData", "Ifoperate", "Ifenclosure"],
  data() {
    return {
      colors: ["#99A9BF", "#F7BA2A", "#FF9900"],
      LabelList: [],
      DataList: []
    };
  },
  methods: {
    deleteClick(row) {
      console.log(row);
    },
    forbiddenClick(row) {
      console.log(row);
    }
  }
  //   watch: {
  //     tableLabel(val) {
  //       this.LabelList = val;
  //     },
  //     tableData(val) {
  //       this.DataList = val;
  //     }
  //   }
};
</script>

<style>
.tableItem .advIndex {
  width: 100%;
  height: auto;
  padding-bottom: 40px;
}
.tableItem .advTable {
  width: 100% !important;
  margin: 0 auto;
  border: 1px solid #dcdfe6;
}
a {
  text-decoration: none;
  color: #fff;
}
</style>